//
//  ProductCentersViewController.m
//  WholesalerApp
//
//  Created by macox on 16/11/2.
//  Copyright © 2016年 macox. All rights reserved.
//

#import "ProductCentersViewController.h"
#import "ProductCenterWareTableViewCell.h"
#import "ProductSubbbModel.h"
#import "ProductCenterWarwHouseView.h"
#import "CommoditySearchViewController.h"
@interface ProductCentersViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UIScrollView *commodityWScrollView;
    NSString *buttonTagNumber;
    NSInteger ERTag;
    UITableViewCell *MyCell;
    NSString *string_ID;
}
@property (nonatomic , strong) UIButton *sellButton ;
@property (nonatomic , strong) UIButton *UnderShelfButton;
@property (nonatomic , strong) UIButton *AuditButton;
@property (nonatomic , strong) UIButton *IllegalButton;
@property (nonatomic , strong) UIView *sellV;
@property (nonatomic,strong)UITableView *commodityWTableView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)NSMutableArray *ERarray;
@property (nonatomic,strong)UIButton *ERButton;
@property (nonatomic,strong)UIView *viewCell;
@property (nonatomic , strong) NSString *BtnIS;
@property (nonatomic,strong)NSString *wocao;
@end

@implementation ProductCentersViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"商品中心";
    self.view.backgroundColor = [UIColor colorWithRed:0.94 green:0.94 blue:0.94 alpha:1.00];
    self.dataArray = [[NSMutableArray alloc]init];
    self.ERarray = [[NSMutableArray alloc]init];
   
    
    [self commodityClassificationDataRequest];
    
    [self createCommodityWarehouseTableView];
    [self createCommodityWarehouseScrollView];
     [self createUI];
    /*
     *返回
     */
    UIImage *commodityWarehouseBackImage = [UIImage imageNamed:@"左箭头"];
    commodityWarehouseBackImage = [commodityWarehouseBackImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:commodityWarehouseBackImage style:UIBarButtonItemStylePlain target:self action:@selector(commodityWarehouseBackImageBackAction)];
    
    /*
     *搜索
     */
//    UIImage *searchImage = [UIImage imageNamed:@"白色放大镜"];
//    searchImage = [searchImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:searchImage style:UIBarButtonItemStylePlain target:self action:@selector(searchImageAction)];
    
    _wocao = @"wocao";
    // Do any additional setup after loading the view.
}
#pragma mark -- 创建视图
- (void)createUI{
    _sellButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_sellButton addTarget:self action:@selector(sellAction1) forControlEvents:UIControlEventTouchUpInside];
    _sellButton.tag = 1000001;
    
//    ProductSaleStatusModel *model = _goodDataStatusArr[0];
//    NSLog(@"--------%@",model.ProductCount);
//    
//    NSString *string = [NSString stringWithFormat:@"出售中(%@)",model.ProductCount];
    
    [_sellButton setTitle:@"出售中" forState:UIControlStateNormal];
    [_sellButton setTitleColor:[UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00] forState:UIControlStateNormal];
    _sellButton.frame = CGRectMake(0, 65, kScrernWidth / 4, 50);
    _sellButton.titleLabel.font    = [UIFont systemFontOfSize: 13];
    _sellButton.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_sellButton];
    
    
    
    _UnderShelfButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_UnderShelfButton addTarget:self action:@selector(UnderShelfAction1) forControlEvents:UIControlEventTouchUpInside];
    _UnderShelfButton.tag = 1000002;
//    ProductSaleStatusModel *model1 = _goodDataStatusArr[2];
//    NSString *string1 = [NSString stringWithFormat:@"已下架(%@)",model1.ProductCount];
    [_UnderShelfButton setTitle:@"已下架" forState:UIControlStateNormal];
    [_UnderShelfButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    _UnderShelfButton.frame = CGRectMake( (kScrernWidth / 4) +1, 65, (kScrernWidth / 4), 50);
    _UnderShelfButton.titleLabel.font    = [UIFont systemFontOfSize: 13];
    _UnderShelfButton.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_UnderShelfButton];
    
    
    
    _AuditButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_AuditButton addTarget:self action:@selector(_AuditButtonAction1) forControlEvents:UIControlEventTouchUpInside];
    _AuditButton.tag = 1000003;
//    ProductSaleStatusModel *model2 = _goodDataStatusArr[1];
//    NSString *string2 = [NSString stringWithFormat:@"审核中(%@)",model2.ProductCount];
    [_AuditButton setTitle:@"审核中" forState:UIControlStateNormal];
    [_AuditButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    _AuditButton.frame = CGRectMake( 2*(kScrernWidth / 4) +2, 65, (kScrernWidth / 4), 50);
    _AuditButton.titleLabel.font    = [UIFont systemFontOfSize: 13];
    _AuditButton.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_AuditButton];
    
    
    
    _IllegalButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_IllegalButton addTarget:self action:@selector(_IllegalButtonAction1) forControlEvents:UIControlEventTouchUpInside];
    _IllegalButton.tag = 1000004;
//    ProductSaleStatusModel *model3 = _goodDataStatusArr[3];
//    NSString *string3 = [NSString stringWithFormat:@"违规下架(%@)",model3.ProductCount];
    [_IllegalButton setTitle:@"违规下架" forState:UIControlStateNormal];
    [_IllegalButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    _IllegalButton.frame = CGRectMake( 3*(kScrernWidth / 4) +3, 65, (kScrernWidth / 4) , 50);
    
    _IllegalButton.titleLabel.font    = [UIFont systemFontOfSize: 13];
    _IllegalButton.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_IllegalButton];
    
    
    _sellV = [[UIView alloc]initWithFrame:CGRectMake(0, 110, (kScrernWidth / 4), 5)];
    _sellV.backgroundColor = [UIColor colorWithRed:0.45 green:0.75 blue:0.21 alpha:1.00];
    [self.view addSubview:_sellV];
    

    
    
    
}
- (void)sellAction1{
//    _pageNumber = 1;
//    [self requestListData:@"1"];
    [_sellButton setTitleColor:[UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00] forState:UIControlStateNormal];
    [_UnderShelfButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
//    _numberl = 1;
//    [self requsetDataStatus000001];
    [_AuditButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_IllegalButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    _sellV.frame = CGRectMake(_sellButton.frame.origin.x, 110, (kScrernWidth / 4), 5);
//    [_sellCenterTableV reloadData];
    [NNSingleton sharedSingleton].btnState = @"1";
    [self commodityClassificationDataRequest];
    NSDictionary *dict =[[NSDictionary alloc] initWithObjectsAndKeys:@"1",@"textOne", nil];
    
    //创建通知
    
    NSNotification *notification =[NSNotification notificationWithName:@"tongzhi" object:nil userInfo:dict];
    
    //通过通知中心发送通知
    
    [[NSNotificationCenter defaultCenter] postNotification:notification];

        _viewCell.frame = CGRectMake(0, 0*50, 5, 50);
     _wocao = @"wocao";
 
}
- (void)UnderShelfAction1{
    
    
    
//    _pageNumber = 1;
//    [self requestListData:@"3"];
    [_sellButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_UnderShelfButton setTitleColor:[UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00] forState:UIControlStateNormal];
    [_AuditButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_IllegalButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
//    _numberl = 2;
//    [self requsetDataStatus000001];
    _sellV.frame = CGRectMake(_UnderShelfButton.frame.origin.x, 110, (kScrernWidth / 4), 5);
//    [_sellCenterTableV reloadData];
    [NNSingleton sharedSingleton].btnState = @"3";
    [self commodityClassificationDataRequest];
    NSDictionary *dict =[[NSDictionary alloc] initWithObjectsAndKeys:@"3",@"textOne", nil];
    
    //创建通知
    
    NSNotification *notification =[NSNotification notificationWithName:@"tongzhi" object:nil userInfo:dict];
    
    //通过通知中心发送通知
    
    [[NSNotificationCenter defaultCenter] postNotification:notification];
      _viewCell.frame = CGRectMake(0, 0*50, 5, 50);
     _wocao = @"wocao";
}

- (void)_AuditButtonAction1{
//    _pageNumber = 1;
//    [self requestListData:@"2"];
    [_sellButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_UnderShelfButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_AuditButton setTitleColor:[UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00] forState:UIControlStateNormal];
    [_IllegalButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
//    _numberl = 3;
//    [self requsetDataStatus000001];
    _sellV.frame = CGRectMake(_AuditButton.frame.origin.x, 110, (kScrernWidth / 4), 5);
//    [_sellCenterTableV reloadData];
    
    [NNSingleton sharedSingleton].btnState = @"2";
    [self commodityClassificationDataRequest];
    NSDictionary *dict =[[NSDictionary alloc] initWithObjectsAndKeys:@"2",@"textOne", nil];
    
    //创建通知
    
    NSNotification *notification =[NSNotification notificationWithName:@"tongzhi" object:nil userInfo:dict];
    
    //通过通知中心发送通知
    
    [[NSNotificationCenter defaultCenter] postNotification:notification];
      _viewCell.frame = CGRectMake(0, 0*50, 5, 50);
     _wocao = @"wocao";
}
- (void)_IllegalButtonAction1{
//    _pageNumber = 1;
//    [self requestListData:@"4"];
    [_sellButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_UnderShelfButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_AuditButton setTitleColor:[UIColor colorWithRed:0.35 green:0.35 blue:0.35 alpha:1.00] forState:UIControlStateNormal];
    [_IllegalButton setTitleColor:[UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00] forState:UIControlStateNormal];
//    _numberl = 4;
//    [self requsetDataStatus000001];
    _sellV.frame = CGRectMake(_IllegalButton.frame.origin.x, 110, (kScrernWidth / 4), 5);
//    [_sellCenterTableV reloadData];
    NSDictionary *dict =[[NSDictionary alloc] initWithObjectsAndKeys:@"4",@"textOne", nil];
    
    
    
    [NNSingleton sharedSingleton].btnState = @"4";
    //创建通知
    [self commodityClassificationDataRequest];
    NSNotification *notification =[NSNotification notificationWithName:@"tongzhi" object:nil userInfo:dict];
    
    //通过通知中心发送通知
    
    [[NSNotificationCenter defaultCenter] postNotification:notification];
      _viewCell.frame = CGRectMake(0, 0*50, 5, 50);
    _wocao = @"wocao";
}
- (void)commodityWarehouseBackImageBackAction{
    [self.navigationController popViewControllerAnimated:YES];
}
//#pragma mark -- 搜索
//- (void)searchImageAction{
//    NSLog(@"搜索");
//        CommoditySearchViewController *commoditySearch = [[CommoditySearchViewController alloc]init];
//        [self.navigationController pushViewController:commoditySearch animated:YES];
//}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
    [NNSingleton sharedSingleton].btnState = @"1";
}

#pragma mark --  创建tableview
- (void)createCommodityWarehouseTableView{
    
    _commodityWTableView =[[UITableView alloc]initWithFrame:CGRectMake(0,50,90,kScrernHeight) style:UITableViewStylePlain];
    _commodityWTableView.showsVerticalScrollIndicator = FALSE;
    _commodityWTableView.delegate=self;
    _commodityWTableView.dataSource=self;
    _commodityWTableView.backgroundColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.94 alpha:1.00];
    _commodityWTableView.tableFooterView = [[UIView alloc] init];
    [self.view addSubview:_commodityWTableView];
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(90, 50, 1, kScrernHeight)];
    view.backgroundColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.93 alpha:1.00];
    [self.view addSubview:view];
    /**左侧一级绿色竖条
     */
    _viewCell = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 5,50)];
    _viewCell.backgroundColor = [UIColor colorWithHue:0.21 saturation:1.00 brightness:0.69 alpha:1.00];
    [_commodityWTableView addSubview:_viewCell];
    
}
#pragma mark -- 单独创建scrollview
- (void)createCommodityWarehouseScrollView{
    
    commodityWScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(91,114, kScrernWidth-91, 50)];
    commodityWScrollView.showsVerticalScrollIndicator = FALSE;
    commodityWScrollView.contentSize = CGSizeMake(kScrernWidth,0);
    commodityWScrollView.delegate = self;
    commodityWScrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:commodityWScrollView];
    
    ERTag = 10;
    for (int i = 0 ; i < _ERarray.count; i++) {
        ProductSubbbModel *modelSub= [_ERarray objectAtIndex:i];
        _ERButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_ERButton addTarget:self action:@selector(CommodityWarehouseERButtonAction:) forControlEvents:UIControlEventTouchUpInside];
        _ERButton.tag = ERTag++;
        _ERButton.titleLabel.font = [UIFont systemFontOfSize:13];
        [_ERButton setTitleColor:[UIColor colorWithHue:0.00 saturation:0.00 brightness:0.28 alpha:1.00] forState:UIControlStateNormal];
        [_ERButton.layer setMasksToBounds:YES];
        //边框宽度
        [_ERButton.layer setBorderWidth:1.0];
        _ERButton.layer.borderColor=[UIColor colorWithHue:0.00 saturation:0.00 brightness:0.93 alpha:1.00].CGColor;
        _ERButton.frame = CGRectMake(0+60*i,0,60,50);
        [_ERButton setTitle:modelSub.Name forState:UIControlStateNormal];
        [commodityWScrollView addSubview:_ERButton];
    }
    commodityWScrollView.contentSize = CGSizeMake(_ERarray.count*60,0);
}
#pragma mark -- 一级分类管理父类数据请求
- (void)commodityClassificationDataRequest{
    [GDJHttpTool get:TwolevelClassification params:@{@"ShouJiHao":GETPHONE,@"Duuid":GETUUID,@"Token":GETTOKEN} success:^(id responseObj) {
        NSLog(@"类似爱情 %@",responseObj[@"Category"]);
        [SVProgressHUD showWithStatus:@"正在加载"];
        
        //查看错误码
        NSInteger err = [[responseObj valueForKey:@"Err"]integerValue];
        NSLog(@"莫文蔚%ld",(long) err);
        if (err == 0) {
            [SVProgressHUD dismiss];
            self.dataArray =   [ProductSubbbModel mj_objectArrayWithKeyValuesArray:[responseObj objectForKey:@"Category"]];
        }
        
        [_commodityWTableView reloadData];
        ProductSubbbModel *modelSub= [_dataArray objectAtIndex:0];
        [NNSingleton sharedSingleton].subId = modelSub.Id;
        [self commodityClassificationDataSubRequest];//子类
        
    }failure:^(NSError *error) {
        NSLog(@"%@",error);
    }];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [_dataArray count];
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *identifer=@"Mycell";
    MyCell=[tableView cellForRowAtIndexPath:indexPath];
    if (MyCell==nil) {
        MyCell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
        //        MyCell.textLabel.textColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.28 alpha:1.00];
        MyCell.textLabel.font = [UIFont systemFontOfSize:14];
        //        MyCell.textLabel.highlightedTextColor = [UIColor colorWithHue:0.22 saturation:0.54 brightness:0.75 alpha:1.00];
    }
    //    MyCell.selectionStyle = UITableViewCellSelectionStyleBlue;
    MyCell.selectedBackgroundView = [[UIView alloc] initWithFrame:self.view.frame];
    MyCell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];
    /**判断位置改变字体颜色
     */
    if ([_wocao isEqualToString:@"wocao"]) {
        if (indexPath.row == 0) {
            MyCell.textLabel.textColor = [UIColor colorWithHue:0.22 saturation:0.54 brightness:0.75 alpha:1.00];
        }else{
            MyCell.textLabel.textColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.28 alpha:1.00];
        }
    }else{
        if (indexPath.row == [_wocao integerValue]) {
            MyCell.textLabel.textColor = [UIColor colorWithHue:0.22 saturation:0.54 brightness:0.75 alpha:1.00];
        }else{
            MyCell.textLabel.textColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.28 alpha:1.00];
        }
    }
    
    ProductSubbbModel *model= [_dataArray objectAtIndex:indexPath.row];
    MyCell.textLabel.text = model.Name;
    
    return MyCell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    /**改变字体用获取位置
     */
     [commodityWScrollView removeFromSuperview];
    _wocao = [NSString stringWithFormat:@"%ld",(long)indexPath.row];
    [_commodityWTableView reloadData];
    /*****/
    [_commodityWarView removeFromSuperview];//remove试图
    _viewCell.frame = CGRectMake(0, indexPath.row*50, 5, 50);
    _commodityWarView = nil;
    buttonTagNumber = @"0";
    
    ProductSubbbModel *modelSub= [_dataArray objectAtIndex:indexPath.row];
    [NNSingleton sharedSingleton].subId = modelSub.Id;
    [self commodityClassificationDataSubRequest];//子类
}
#pragma mark -- 二级分类管理子类数据请求
- (void)commodityClassificationDataSubRequest{
    [_ERarray removeAllObjects];
    buttonTagNumber = @"0";
    [commodityWScrollView removeFromSuperview];
    MyCell.textLabel.textColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.28 alpha:1.00];
    
    NSString *subID_str = [NSString stringWithFormat:@"%d",[NNSingleton sharedSingleton].subId];
    [GDJHttpTool get:TwolevelClassificationSub params:@{@"ShouJiHao":GETPHONE,@"Duuid":GETUUID,@"Token":GETTOKEN,@"ParentId":subID_str} success:^(id responseObj) {
        NSLog(@"海若有因 %@",responseObj);
        
        //查看错误码
        NSInteger err = [[responseObj valueForKey:@"Err"]integerValue];
        NSLog(@"争取吧%ld",(long) err);
        if (err == 0) {
            if ([responseObj objectForKey:@"SecondCategory"] == [NSNull alloc]) {
                buttonTagNumber = @"3";
            }else{
                _ERarray =   [ProductSubbbModel mj_objectArrayWithKeyValuesArray:[responseObj objectForKey:@"SecondCategory"]];
                [self createCommodityWarehouseScrollView];
            }
            [self commodityLibraryInformationDataRequest];
        }
    }failure:^(NSError *error) {
        NSLog(@"%@",error);
    }];
}
- (void)CommodityWarehouseERButtonAction:(UIButton *)sender{
    [self commodityLibraryInformationDataRequest];
    buttonTagNumber = @"1";
    NSInteger tagNumber = sender.tag-10;
    
    ProductSubbbModel *modelSub= [_ERarray objectAtIndex:tagNumber];
    string_ID = [NSString stringWithFormat:@"%ld",(long)modelSub.Id];
    NSLog(@"一万个理由  %@",string_ID);
    /**显示button边框
     **/
    _ERButton.layer.borderColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.92 alpha:1.00].CGColor;
    
    _ERButton = (UIButton *)[self.view viewWithTag:sender.tag];
    _ERButton.layer.borderColor = [UIColor colorWithHue:0.22 saturation:0.54 brightness:0.75 alpha:1.00].CGColor;
    
    [self commodityLibraryInformationDataRequest];
}
#pragma mark -- 获取商品库信息
- (void)commodityLibraryInformationDataRequest{
    NSString *stringID;
    NSString *hidden;
    
    if (([buttonTagNumber isEqualToString:@"0"])) {//为选中二级分类第0个全部
        if (_ERarray.count != 0) {
            hidden = @"";
            ProductSubbbModel *modelSub= [_ERarray objectAtIndex:0];
            stringID = [NSString stringWithFormat:@"%d",modelSub.Id];
            NSLog(@"-------真心英雄 %@",stringID);
            _ERButton = (UIButton *)[self.view viewWithTag:10];
            _ERButton.layer.borderColor = [UIColor colorWithHue:0.22 saturation:0.54 brightness:0.75 alpha:1.00].CGColor;
        }else{//如果二级分类为nil就取一级分类id
            hidden = @"yes";
            stringID = [NSString stringWithFormat:@"%d",[NNSingleton sharedSingleton].subId];
        }
    }else {
        /**选中的二级分类id
         */
        hidden = @"";
        NSLog(@"真心英雄 %@",string_ID);
        stringID = string_ID;
    }
    [NNSingleton sharedSingleton].ERJIID = stringID;
    
    /*二级分类下的商品库
     **/
    _commodityWarView = [[ProductCenterWarwHouseView alloc]init];
    _commodityWarView.BtnIS = @"2";
    if ([hidden isEqualToString:@"yes"]) {
        _commodityWarView.frame = CGRectMake(91,114, kScrernWidth-90, kScrernHeight);
    }else{
        _commodityWarView.frame = CGRectMake(91,164, kScrernWidth-90, kScrernHeight);
    }
    [self.view addSubview:_commodityWarView];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
